package TCP_chat;
//package com;

import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;

public class NgocClient {
	public static void main(String[] args) throws Exception{
		//1. Client send request server
		Socket soc=new Socket("127.0.0.1", 9999);
		PrintWriter out=new PrintWriter(soc.getOutputStream(), true);
		String request="chieu nay di hoc nghe Hao du-";
		out.println(request);
		//5. nhan response tu server
		Scanner in=new Scanner(soc.getInputStream());
		String response=in.nextLine();
		//6. manipulate response
		System.out.println(response);
		
		out.close();in.close();
		soc.close();
	}
	
	
}
